<?php
defined('OA_LIB_PATH') || define('OA_LIB_PATH', '/opt/op/OALib');
defined('OA_LIB_PATH') || define('OA_LIB_PATH', '/opt/op/OALib');

require_once 'Log.php';
require_once OA_LIB_PATH . '/util/helper/daemon.php';
require_once OA_LIB_PATH . '/util/config/Config.php';
require_once OA_LIB_PATH . '/inner/stat/OaGearmanAgent.php';

daemonize();

$logger = Log::factory('console', '', '', array(), PEAR_LOG_INFO);
$opGearmanAgent = new OaGearmanAgent($logger);
$jobServers = Oa_Util_Config::getConfig('job_servers');
$opGearmanAgent->run($jobServers);